<template>
    <a-modal
        :maskClosable="false"
        :destroyOnClose="true"
        title="资料变更审核"
        centered
        width="60%"
        v-model="visible"
    >
        <a-form-model ref="ruleForm" :model="form" :label-col="labelCol" :wrapper-col="wrapperCol">
            <a-form-model-item label="审核状态">
                <a-radio-group v-model="form.status">
                    <a-radio :value="1">通过</a-radio>
                    <a-radio :value="2">拒绝</a-radio>
                </a-radio-group>
            </a-form-model-item>
            <a-form-model-item label="审核备注">
                <a-textarea v-model="form.remark" placeholder="请输入审核备注" :rows="4" />
            </a-form-model-item>
        </a-form-model>
        <template slot="footer">
          <a-button @click="visible = false">取消</a-button>
          <a-button style="margin-left: 10px" type="primary" @click="submitForm">确认</a-button>
        </template>
    </a-modal>
</template>

<script>
import { infoApplyReview } from '@/api/member/member'
export default {
    data(){
        return {
            labelCol: { span: 4 },
            wrapperCol: { span: 14 },
            visible: false,
            form: {
                id: undefined,
                status: 0,
                remark: undefined
            }
        }
    },
    methods: {
        show(id, status){
            this.form.id = id
            this.form.status = status
            this.visible = true
        },
        async submitForm(){
            let { code, msg } = await infoApplyReview({ ...this.form })
            this.$message[code === 0 ? 'success' : 'error'](msg)
            if(code === 0){
                this.$emit('success')
                this.visible = false
            }
        }
    }
}
</script>

<style>

</style>